home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Extensions… / PostScript Extension Shell ƒ / About PostScript Extension… next >
Encoding:
Text File  |  1995-04-10  |  2.7 KB  |  64 lines  |  [ttro/ttxt]

  1. About “PS Extension”…
  2.  
  3. “PS Extension” is a slightly modified version of the “Extension Shell" which appears elsewhere on this CD.  The only significant difference between this printing extension and the “Extension Shell” sample is that this one overrides a PostScript imaging system message, whereas the other only overrides "universal" messages.
  4.  
  5. This printing extension adds a panel to the print dialog and makes your Macintosh beep every time a PostScript driver starts preparing a page on a printer (at GXDoPostScriptPageSetup time).  The extension can be turned on and off through the print panel.  It's turned on by default.
  6.  
  7. Note that this printing extension is only functional for PostScript printer drivers.
  8.  
  9.  
  10.                 Additional Requirements for Overriding Imaging System Messages 
  11.                 -----------------------------------------------------------------------------
  12.  
  13. When you override imaging-system-specific messages, like the GXDoPostScriptPageSetup message in this example, you must provide a 'post', 'rast', or 'vect' resource which contains the ID of a separate 'over' resource for the PostScript, raster, or vector messages you're overriding.  (You can't have one 'over' resource containing both your universal and PostScript overrides, for example.)
  14.  
  15. The ID for the override mapping resource must be gxExtensionImagingOverrideSelectorID.
  16.  
  17. The 'post', 'rast', and 'vect' resource types are not declared in the QuickDraw GX interface files.  You should declare them yourself like so:
  18.  
  19. // gxPostscriptPrinterType is defined as 'post',
  20. // gxRasterPrinterType is defined as 'rast', and
  21. // gxVectorPrinterType is defined as 'vect' in PrintingResTypes.h
  22.  
  23. type gxPostscriptPrinterType
  24. {
  25.      integer;        // ID of 'over' resource to use.
  26. };
  27.  
  28. type gxRasterPrinterType as gxPostscriptPrinterType;
  29. type gxVectorPrinterType as gxPostscriptPrinterType;
  30.  
  31.  
  32. In PS Extension, we're overriding GXDoPostScriptPageSetup, so we use this 'post' resource:
  33.  
  34. resource gxPostscriptPrinterType (gxExtensionImagingOverrideSelectorID, sysheap, purgeable)
  35. {
  36.      gxExtensionUniversalOverrideID +1
  37. };
  38.  
  39.  
  40. …which points to the following 'over' resource, containing the message we want to override:
  41.  
  42. resource gxOverrideType (gxExtensionUniversalOverrideID +1, sysheap, purgeable)
  43. {
  44.     {
  45.         // message to override                    segmentID        offset into jump table
  46.      gxPostScriptDoPageSetup,                        0,                                            20
  47.     };
  48. };
  49.  
  50.  
  51. This extension shows:
  52.  
  53. • How to write an extension which installs a panel, handles panel events and uses the way-cool ‘xdtl’ resources.
  54.  
  55. • How to perform overrides of PostScript, raster, or vector imaging messages.
  56.  
  57. • How to easily set up an A5 world so that you can access global data.
  58.  
  59. Dave Hersey
  60. Apple Developer Technical Support
  61.  
  62. 7/14/94
  63. v1.0
  64.